package com.liys.authority_liys;

import java.io.*;
import java.util.HashMap;
import java.util.Set;

public class outPutStream {
/*
*  字节缓冲流
*  BufferedInputStream bis = new BufferedInputStream(new FileInputStream("bis.txt"));
*  BufferedOutputStream
*  字节流
*  FileInputStream
*  FileOutPutStream
*  字符流
*  FileReader   read
*  FileWriter   write
*  字符缓冲流
*  BufferedReader br = new BufferedReader(new FileReader("in.txt"));
*  readLine 一行一行读取
*  BufferedWriter bw = new BufferedWriter(new FileWriter("out.txt"));
*  newLine 换行写入
*  转换流  字节流转换字符流
*  OutputStreamWriter os =new OutputStreamWriter(new FileOutputStream(FileName2),"GBK");
*  InputStreamReader is =new InputStreamReader(new   FileinputStream(FileName2),"GBK");
*
*
* */


    public static void main(String[] args)throws Exception {
   // 创建map集合,保存文本数据,键为序号,值为文字       
        // 字符缓冲流
        BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\log\\chushibiao.txt"));
        Writer out;
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\log\\chushibiao_new.txt"));
        // 创建一个HashMap
        HashMap<String, String> hashMaps = new HashMap<String, String>();
        String s ="";
         while ((s=bufferedReader.readLine())!=null){
             String[] split = s.split("\\.");
              hashMaps.put(split[0],split[1]);
         }
            Set<String> strings = hashMaps.keySet();
            for (String s1 :strings){
                bw.write(s1);
                bw.write(hashMaps.get(s1));
                bw.newLine();
            }
        bw.close();
        bufferedReader.close();
    }



    }
